/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : 
  * @brief          : 
  ******************************************************************************
  * @attention
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __TRAJECTORY_H
#define __TRAJECTORY_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "stm32g4xx_hal.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */
typedef struct
{
    //The units of RPM are all seconds
    //speed ramp
	float velocity_target;
	float velocity_acc;
	float velocity_dec;
	float velocity_limit;
    //position trajectory
    float limit;
    float acc;
    float dec;
    float step;
    float start;
    float final;
    float time[4];
    float theta;
    float VMax;//maxnimun velocity
    float Vt;//present velocity
    float V0;//initial velocity
    float Ta;
    float Td;
    float Tm;
    float elapsetime;
    char flag;
} _TrajectoryStruct;
/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
/* USER CODE BEGIN EFP */
void Trajectory_Parameters_Reset(void);
void Trajectory_Parameters_Updata(void);
float Ramp_Speed(float set);
void Trajectory_MoveCommand(float StartAngle, float FinalAngle);
float Trajectory_Move(void);
/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
/* USER CODE BEGIN Private defines */


/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif 
